<?php


namespace App\Http\Controllers;


use Illuminate\Support\Facades\DB;

class UserController extends Controller
{
    function desc($id)
    {
        $data = DB::table('dobo')->where('id', $id)->get();
        return view('desc',['data'=>$data]);
    }

    public function login($uid)
    {
        session(['uid' => $uid]);
        dump('登录成功,uid为:'.session('uid'));
    }

    public function index()
    {
        $user = DB::table('users')->where('uid',session('uid'))->get();
        foreach ($user as $v){
            return '欢迎光临:'.$v->name.'_访问index';
        }
    }

    public function buy()
    {
        echo 'post↓';
        return $_POST;
    }

    public function Cno()
    {
        return "无此用户";
    }

    public function my()
    {
        $data = DB::table('user')->get();
        dump($data);
    }
}
